home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / BORL_TIP / TI100 / TI457.ASC < prev    next >
Text File  |  1992-08-12  |  6KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  9.   VERSION  :  4.0
  10.        OS  :  PC-DOS
  11.      DATE  :  January 3, 1990                          PAGE  :  1/4
  12.  
  13.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  14.  
  15.  
  16.  
  17.  
  18.   This technical information  handout  describes how to link in the
  19.   ERROR.MSG, 4x6.FON, 8x8.FON and 14x9.FON  files  into  your *.EXE
  20.   file so that your  application  no longer needs these files to be
  21.   present on disk.  Please make these changes to  copies of your
  22.  
  23.   GRAF3270.DVR   GRAFEGA.DVR  ERROR.MSG   14X9.FON
  24.   GRAFATT.DVR    GRAFHGC.DVR  4X6.FON     GDRIVER.PAS
  25.   GRAFCGA.DVR    GKERNEL.PAS  8X8.FON
  26.  
  27.  
  28.   First, you must  convert  the  ERROR.MSG,  4x6.FON,  8x8.FON, and
  29.   14x9.FON files to  the OBJ format.
  30.  
  31.   Use  the BINOBJ.EXE utility to convert these  files  to  the  OBJ
  32.   format.
  33.  
  34.   For example,
  35.  
  36.           BINOBJ ERROR.MSG ERROR.OBJ FakeErr <Return>
  37.           BINOBJ 4x6.FON  4x6.OBJ Font4x6 <Return>
  38.           BINOBJ 8x8.FON  8x8.OBJ FakeFont <Return>
  39.           BINOBJ 14x9.FON  14x9.OBJ FakeFont <Return>
  40.  
  41.  
  42.   Next, delete the  first  13  lines  of  code  from  the procedure
  43.   EnterGraphic in each of the  *.DVR and GDRIVER.PAS files with the
  44.   exception of GRAFATT.DVR  file.   In the GRAFATT.DVR file, delete
  45.   the first 15 lines of code instead. Also, in the GRAFCGA.DVR file
  46.   s
  47.  
  48.  
  49.  
  50.   {$L 14x9}       { ADD }
  51.   procedure FakeFont; external;   { ADD }
  52.  
  53.   procedure EnterGraphic;
  54.   { Enter graphics mode }
  55.   ...
  56.   ...
  57.   begin
  58.    if not FontLoaded then   { ADD }
  59.     begin                   { ADD }
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  75.   VERSION  :  4.0
  76.        OS  :  PC-DOS
  77.      DATE  :  January 3, 1990                          PAGE  :  2/4
  78.  
  79.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  80.  
  81.  
  82.  
  83.  
  84.       Move(Mem[Seg(FakeFont):Ofs(FakeFont)], Font, SizeOf(Font));
  85.                                {ADD}
  86.        FontLoaded := true;     { ADD }
  87.     end;                       { ADD }
  88.   ....
  89.   .....
  90.   The rest of the EnterGraphic procedure remains the same.
  91.  
  92.  
  93.   The following changes should be made in the GKERNEL.PAS unit:
  94.  
  95.   {$L 4x6 }                                          {NEW}
  96.   procedure Font4x6; external;                       {NEW}
  97.  
  98.   {$L Error}                                         {NEW}
  99.   procedure FakeErr; external;                       {NEW}
  100.  
  101.   procedure InitGraphic;
  102.   var
  103.     Fil : file of CharArray;
  104.     Tfile : text;
  105.     Test : ^integer;
  106.     Temp : WrkString;
  107.     I : word;
  108.     GTBCount : integer;                              {NEW}
  109.     GTBch    : char;                                 {NEW}
  110.  
  111.     Function ErrorStr : WrkString;                   {NEW}
  112.     begin                                            {NEW}
  113.       temp := '';                                    {NEW}
  114.       repeat                                         {NEW}
  115.         GTBch := chr(mem[Seg(FakeErr):Ofs(FakeErr) + GTBcount]);
  116.         if not ((GTBch = #10) or (GTBch = #13)) then {NEW}
  117.           temp := temp + GTBch;                      {NEW}
  118.         inc(GTBcount);                               {NEW}
  119.       until(GTBch = #13);                            {NEW}
  120.       ErrorStr := temp;                              {NEW}
  121.     end; { Function ErrorStr }                       {NEW}
  122.  
  123.   begin
  124.     MessageGlb := true;
  125.     BrkGlb := false;
  126.     GrafModeGlb := false;
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  141.   VERSION  :  4.0
  142.        OS  :  PC-DOS
  143.      DATE  :  January 3, 1990                          PAGE  :  3/4
  144.  
  145.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  146.  
  147.  
  148.  
  149.  
  150.     GotoXY(1, 1);
  151.     if not HardwarePresent then
  152.     begin
  153.       ClrScr;
  154.       GotoXY(1, 2);
  155.       WriteLn('Fatal  Error:  graphics hardware not  found  or  not
  156.   properly activated');
  157.       Halt;
  158.     end;
  159.     GetMem(ErrorProc[0], 16);
  160.     GetMem(ErrorCode[0], 24);
  161.     ErrorProc[0]^ := 'InitGraphic';
  162.     ErrorCode[0]^ := 'Error.MSG missing';
  163.     GTBcount := 0;                                   {NEW}
  164.     for I := 0 to MaxProcsGlb do                {MODIFIED}
  165.       begin
  166.         Temp := ErrorStr;                            {NEW}
  167.         if I <> 0 then
  168.           GetMem(ErrorProc[I], Length(Temp) + 1);
  169.         ErrorProc[I]^ := Temp;
  170.       end;
  171.     for I := 0 to MaxErrsGlb do                 {MODIFIED}
  172.       begin
  173.         Temp := ErrorStr;                            {NEW}
  174.         if I <> 0 then
  175.           GetMem(ErrorCode[I], Length(Temp) + 1);
  176.         ErrorCode[I]^ := Temp;
  177.       end;
  178.     PcGlb := ErrorStr;                          {MODIFIED}
  179.     for I := 1 to MaxWorldsGlb do
  180.       DefineWorld(I, 0, 0, XScreenMaxGlb, YMaxGlb);
  181.     MaxWorldGlb := 1;
  182.     for I := 1 to MaxWindowsGlb do
  183.     begin
  184.       DefineWindow(I, 0, 0, XMaxGlb, YMaxGlb);
  185.       with Stack[I] do
  186.       begin
  187.         W.Size := 0;
  188.         Contents := nil;
  189.       end;
  190.     end;
  191.     MaxWindowGlb := 1;
  192.     Move(mem[seg(Font4x6):ofs(Font4x6)],CharSet,Sizeof(CharSet));
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  207.   VERSION  :  4.0
  208.        OS  :  PC-DOS
  209.      DATE  :  January 3, 1990                          PAGE  :  4/4
  210.  
  211.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  212.  
  213.  
  214.  
  215.  
  216.     {NEW}
  217.  
  218.     Delete the next 12 lines of code.
  219.  
  220.     The rest of the code remains the same in the GKERNEL.PAS unit.
  221.     BrkGlb := True;
  222.     If RamScreenGlb Then
  223.     ...
  224.     ...
  225.  
  226.   ****************************************************************
  227.  
  228.  
  229.  
  230.   DISCLAIMER: You  have the right to use this technical information
  231.   subject to the terms  of  the  No-Nonsense License Statement that
  232.   you received with  the  Borland product to which this information
  233.   pertains.
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.